import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-07-09
 * Time: 19:12
 */
public class test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[n] = in.nextInt();
            }
            // 转变成大根堆
            PriorityQueue<Integer> heap = new PriorityQueue<>((x,b)->{
                return b-x;
            });
            long sum = 0;
            for(int i=0;i<n;i++){
                sum += a[i];
                if(a[i]%2==0){
                    heap.add(a[i]);
                }
            }

            while(!heap.isEmpty() && k-- !=0){
                long t = heap.poll()/2;
                sum -=t;
                if(t%2==0){
                    heap.add((int) t);
                }
            }

            System.out.println(sum);
        }
    }
}
